Fix Hub token reserve location for post-AHM XCM transfers#5
Open
rockbmb wants to merge 2 commits into
Open
Conversation
Author
|
I made this PR to the Let me know if this PR is helpful or not 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In the Basilisk runtime, the KSM token's reserve is set to
Location::parent(); this is relative to itself, meaning it refers to the relay chain.See:
open-runtime-module-library/traits/src/location.rs
Lines 16 to 26 in d20eee8
Post-AHM, the reserve is Asset Hub, i.e. parachain 1000. This breaks horizontal KSM token transfers, as
xTokensincorrectly routes through the relay instead of AH.Changes
chain_part():(1, _)→Location::new(1, [Parachain(1000)])instead ofLocation::parent()AbsoluteReserveProvider/RelativeReserveProvidermoved fromorml_traits::locationtoorml_xtokensAdded
ASSET_HUB_ID = 1000constant intraits/src/location.rsMock tests updated: Asset Hub parachain added; relay trusts AH for teleports
Based on open-web3-stack#1033. open-web3-stack#1035.
Validation
Validated with Polkadot Ecosystem Tests (
basilisk.karura.xcmsuite).Current behavior: Basilisk -> Karura transfer of KSM produced empty HRMP messages, zero balance on the destination chain, Karura
Behavior with this patch: after building the Basilisk runtime with its ORML dependencies patched to this PR's branch and running PET with
BASILISK_WASMoverride, the Basilisk -> Karura KSM transfer worked.Reproducing with PET
BASILISK_WASM=/path/to/basilisk_runtime.compact.compressed.wasm yarn test basilisk.karura.xcm